package com.zz.common.utils;

import android.util.Log;

public final class ZLog {
	
	/**
	 * only console, only debug version;
	 */
	public static final int LOG_LEVEL_DEBUG = 0x01;
	
	/**
	 * console and local file, only debug version;
	 */
	public static final int LOG_LEVEL_DEV = 0x02;
	
	/**
	 * console and local file, debug version and release version;
	 */
	public static final int LOG_LEVEL_KEY = 0x03;
	
	public static int sLogLevel = LOG_LEVEL_DEBUG;
	
	/**
	 * d(tag, {@link LOG_LEVEL_DEV}, content)
	 */
	public static void d(String tag, byte[] content) {
		d(tag, LOG_LEVEL_DEV, content);
	}
	
	/**
	 * 
	 * @param logLevel {@link LOG_LEVEL_DEBUG}, {@link LOG_LEVEL_DEV}, {@link LOG_LEVEL_KEY}
	 */
	public static void d(String tag, int logLevel, byte[] content) {
		if(logLevel >= sLogLevel) {
			String strContent = new String(content);
			d(tag, logLevel, strContent);
		}
	}
	
	/**
	 * d(tag, {@link LOG_LEVEL_DEV}, content)
	 */
	public static void d(String tag, String content) {
		d(tag, LOG_LEVEL_DEV, content);
	}
	
	/**
	 * 
	 * @param logLevel {@link LOG_LEVEL_DEBUG}, {@link LOG_LEVEL_DEV}, {@link LOG_LEVEL_KEY}
	 */
	public static void d(String tag, int logLevel, String content) {
		if(logLevel >= sLogLevel) {
			Log.d(tag, content);
		}
	}
}
